{extend name="../../admin/view/public/admin"}

{block name='content'}

<style>
    .multi-item {
        margin-bottom: 18px;
    }
</style>

<div class="page-header">
    当前位置：<span class="text-primary">{if !empty($item)}编辑{else}新建{/if}文章
    	<small>{if !empty($item)}(名称: {$item['company']}){/if}</small>
    </span>
</div>

<div class="page-content">

    <form action="" method="post" class="form-validate form-horizontal ">
        <input type="hidden" name="id" value="{$item['id']}"/>

        <div class="form-group-title">轮播信息</div>

        <div class="form-group">
            <label class="col-lg control-label must">排序</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="displayorder" class="form-control" value="{:intval($item['displayorder'])}" data-rule-required='true'/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label must">分类</label>
            <div class="col-sm-9 col-xs-12">
                <select name='cateid' class='form-control'>
                    <option value="">选择分类</option>
                    {foreach $categorys as $key => $row}
                        <option value="{$row['id']}" {if $row['id']==$item['cateid']}selected{/if}>{$row['name']}</option>
                    {/foreach}
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">轮播标题</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="title" class="form-control" value="{$item['title']}"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">轮播图</label>
            <div class="col-sm-9 col-xs-12">
                {:tpl_form_field_image('thumb', $item['thumb'])}
                <span class="help-block">尺寸比例为 16:9 </span>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">跳转地址</label>
            <div class="col-sm-9 col-xs-12">
                <input type="text" name="link" class="form-control" value="{$item['link']}"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label">显示状态</label>
            <div class="col-sm-9 col-xs-12">
                <label class="radio-inline">
                    <input type="radio" name="enabled" value="0" {if $item['enabled']==0 || empty($item)}checked="checked"{/if}> 隐藏
                </label>
                <label class="radio-inline">
                    <input type="radio" name="enabled" value="1" {if $item['enabled']==1}checked="checked"{/if}> 显示
                </label>
            </div>
        </div>

        <div class="form-group">
            <label class="col-lg control-label"></label>
            <div class="col-sm-9">
                <input type="submit" class="btn btn-primary" value="保存">
                <a class="btn btn-default" href="{:webUrl('web.adv/main')}">返回列表</a>
            </div>
        </div>

    </form>
</div>


{/block}